/*
 *  Copyright 2008 Martin Fryč (martin@fryc.eu).
 * 
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 * 
 *       http://www.apache.org/licenses/LICENSE-2.0
 * 
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 *  under the License.
 */

package eu.fryc.martin.micromq.storage;

import javax.jms.Destination;
import javax.jms.InvalidDestinationException;
import javax.jms.JMSException;

/**
 * Destination manager for different destination types.
 * 
 * @author mfryc
 */
public interface DestinationManager extends DestinationStorage {

	/**
	 * Create new destination.
	 * 
	 * @param destination
	 *            destination
	 * 
	 * @throws javax.jms.JMSException
	 *             if destionation creation fail
	 */
	public void create(Destination destination) throws JMSException;

	/**
	 * Check if destination exists.
	 * 
	 * @param destination
	 *            destination
	 * 
	 * @return true if destination exists
	 */
	public boolean exists(Destination destination);

	/**
	 * Delete existing destination. Destination cannot contain any messages.
	 * 
	 * @param destination
	 *            destination
	 * 
	 * @throws javax.jms.JMSException
	 *             if destionation delete fail
	 * @throws javax.jms.InvalidDestinationException
	 *             if destination does not exists
	 */
	public void delete(Destination destination) throws JMSException, InvalidDestinationException;

}
